home *** CD-ROM | disk | FTP | other *** search
- /* James Manning (Flav@IRC) 1/29/94 at 7:30am */
- /* to set up the irc alias: */
- /* cc -o random random.c */
- /* /ALIAS morph /exec -out echo "$0-" | random */
- /* name of the compile of this code ^^^^^^ */
-
- /* Then just "/morph whatever you want to say" */
-
- #include <stdio.h>
- #include <stdlib.h>
-
- char set_to_lower(char tmp){
- char x = tmp;
- if((x<='Z')&&(x>='A')) {
- x -= 'A';
- x += 'a';
- }
- return x;
- }
-
- char return_random(char tmp){
- char x = tmp;
- if ((((x<='Z')&&(x>='A'))||((x<='z')&&(x>='a')))&&((rand()%100)>50)){
- x -= 'a';
- x += 'A';
- }
- return x;
- }
-
- main(){
- char a_char;
- srand(getpid());
- a_char = getchar();
- while(a_char!=EOF){
- switch(rand()%3){
- case(0): printf("\026"); break;
- case(1): printf("\002"); break; /* adds in random ^V ^B and ^_ */
- case(2): printf("\037"); break; /* uncomment if wanted */
- }
- printf("%c",return_random(set_to_lower(a_char)));
- a_char = getchar();
- }
- }
-